home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 11 / AMUG BBS in a Box Volume XI (April 1994) (MacWizards).iso / Files / Prog / T / ToolsPlus 2.1.sit / Tools Plus 2.1 ƒ / Tools Plus 2.1 (C & Pascal) / User Manual / 12-System Polling (3 of 4) < prev    next >
Encoding:
Text File  |  1993-10-24  |  31.1 KB  |  696 lines  |  [TEXT/ttxt]

  1. doNothing (event)
  2. `````````````````
  3. No event has occurred.  Also called a “null event.”
  4.  
  5.   The doNothing event indicates that the event queue is empty and that no event has occurred.  This occurs only when PollSystem returns with a value of false.
  6.  
  7. Programming Considerations
  8. ``````````````````````````
  9. • Applications that do on-going processing while waiting for events
  10.   should do their processing only when a null event is received.
  11.  
  12. ------------------------------------------------------------------------
  13.  
  14. doChgWindow (event)
  15. ```````````````````
  16. Request to activate an inactive window that belongs to your application.
  17.  
  18.   The request to activate an inactive window is made in response to the user clicking anywhere on an inactive window that belongs to your application.  However, there is one exception.  If the user clicks in an inactive window’s title bar while holding the Command key, the window is dragged without being activated.
  19.  
  20. Programming Considerations
  21. ``````````````````````````
  22. • A window can be activated by using the ActivateWindow procedure.
  23.  
  24. • If the active window has an active editing field, you may want to
  25.   validate the edited text before allowing the user to activate another
  26.   window.  If this is the case, use GetFieldString to obtain a copy of
  27.   the edited text, then your application can check the string for
  28.   errors.  If an error is detected, display an appropriate alert box and
  29.   ignore the doChgWindow event.  If no error is detected, call the
  30.   SaveFieldString procedure to save the edited text as the field’s
  31.   string, then activate the required window.
  32.  
  33. • If your application decides not to allow the user to activate a
  34.   window, it should display an appropriate alert box to explain why.
  35.  
  36. • The doChgWindow event will never occur when a modal window is active,
  37.   or when the watch cursor is displayed since other windows belonging to
  38.   your application cannot be clicked.
  39.  
  40. • If your application is running under Finder (System 6 or prior), a
  41.   doChgWindow event will not occur when the user [1] clicks a desk
  42.   accessory from an active window, [2] clicks a desk accessory from
  43.   another active desk accessory, or [3] clicks the previously active
  44.   window from an active desk accessory.  These are all handled
  45.   automatically.
  46.  
  47. Valid Polling Record Fields
  48. ```````````````````````````
  49. Poll.Window
  50.  
  51. ------------------------------------------------------------------------
  52.  
  53. doRefresh (event)
  54. `````````````````
  55. A window’s contents need to be refreshed (redrawn).
  56.  
  57.   Your application must respond to this event.  The doRefresh event occurs when a window is completely or partially obscured, then becomes uncovered.  Tools Plus takes care of redrawing buttons, scroll bars, editing fields, list boxes, and custom controls.  Your application must take care of refreshing anything else, such as icons, pictures, lines, or text that it may have put in the window.
  58.  
  59.   When a doRefresh event is reported, the window’s “update region” will define the exact areas that need to be refreshed.  Although you can redraw everything in the window, only the parts of the window that are visible and which need refreshing will actually be redrawn.
  60.  
  61. Programming Considerations
  62. ``````````````````````````
  63. • When your application detects a doRefresh event, it should respond in
  64.   the following manner:
  65.  
  66.  
  67. CurrentWindow(Poll.Window);            {Make the affected window the   }
  68.                                        {  current grafPort.            }
  69. BeginUpdate(WindowPointer(Poll.Window));{Drawing will occur only within}
  70.                                         {  the area that needs         }
  71.                                         {  refreshing (includes all    }
  72.                                         {  monitors).                  }
  73. for theScreen:=1 to NumberOfScreens do {Repeat drawing for each monitor}
  74.   begin                                {  in which the window appears. }
  75.     BeginUpdateScreen(theScreen);      {Drawing area reduced to the    }
  76.                                        {  specified screen.            }
  77.  
  78.     {   …insert your color-dependent drawing code here…   }
  79.  
  80.     EndUpdateScreen;                   {End the drawing for this       }
  81.                                        {  monitor, and restore the     }
  82.                                        {  window’s visible (drawing)   }
  83.   end;                                 {  region.                      }
  84.  
  85.  {   …insert your color-independent drawing code here…   }
  86.  
  87. EndUpdate(WindowPointer(Poll.Window)); {End the update for the window  }
  88. CurrentWindowReset;                    {Reset the current window to be }
  89.                                        {  the same as the active window}
  90.                                        {  (optional command).          }
  91.  
  92.  
  93. • If your application did not put anything in the window except buttons,
  94.   scroll bars, editing fields, list boxes, and custom controls, all it
  95.   needs is the BeginUpdate and EndUpdate routines.  Note that
  96.   BeginUpdate and EndUpdate cannot be nested.
  97.  
  98. • It is possible that several windows will need to be refreshed
  99.   simultaneously if, for instance, a closing window exposed three
  100.   windows behind it.  PollSystem reports a single doRefresh event each
  101.   time it is called in the event loop, one event for each window that
  102.   needs refreshing.
  103.  
  104. • Unlike traditional Pascal, a doRefresh event is not generated when a
  105.   window is first opened.
  106.  
  107. • A doRefresh event is not generated for desk accessories, dialogs,
  108.   alerts, or Dynamic Alerts.  These events are handled automatically.
  109.  
  110. Valid Polling Record Fields
  111. ```````````````````````````
  112. Poll.Window
  113.  
  114. ------------------------------------------------------------------------
  115.  
  116. doGoAway (event)
  117. ````````````````
  118. Request to close the active window.
  119.  
  120.   The request to close the active window is made in response to the user clicking inside the window’s “close” box.  This has the same effect as choosing the File menu’s Close item.
  121.  
  122. Programming Considerations
  123. ``````````````````````````
  124. • A window is closed by using the WindowClose procedure.
  125.  
  126. • If the window has an active editing field, you may want to validate
  127.   its edited text before allowing the user to close the window.  If this
  128.   is the case, use GetFieldString to obtain a copy of the edited text,
  129.   then your application can check the string for errors.  If an error is
  130.   detected, display an appropriate alert box and ignore the doGoAway
  131.   event.  If no error is detected, call the SaveFieldString procedure to
  132.   save the edited text as the field’s string, then close the required
  133.   window.
  134.  
  135. • If any changes have been made in the window’s data, your application
  136.   should display an appropriate alert box and ask the user if changes
  137.   should be saved.  The options should be Yes, No, and Cancel, the last
  138.   of which would ignore the doGoAway event.
  139.  
  140. • If a modal window has a “close” box and the operator types Command-W,
  141.   a doGoAway event is generated for that window.
  142.  
  143. • The doGoAway event will never occur when the watch cursor is
  144.   displayed, since the close box cannot be clicked.
  145.  
  146. • A doGoAway event is not generated when the user clicks a desk
  147.   accessory’s close box.  The desk accessory is closed automatically.
  148.  
  149. Valid Polling Record Fields
  150. ```````````````````````````
  151. Poll.Window
  152. Poll.Modifiers
  153.  
  154. ------------------------------------------------------------------------
  155.  
  156. doButton (event)
  157. ````````````````
  158. Indicator that user has clicked a button.
  159.  
  160.   The doButton event reports that the user has clicked a button in the active window.  This includes push buttons, check boxes and radio buttons.  The doButton event is also reported if the active window has a default push-button, and the user pressed the Return or Enter key to invoke the default.  If this is the case, the window’s default button will already have been “flashed” as if the user had clicked it.
  161.  
  162. Programming Considerations
  163. ``````````````````````````
  164. • If the user clicked a check box, use SelectButton to reverse the check
  165.   box’s selection (i.e. select or deselect it).
  166.  
  167. • If the user clicked a radio button, use SelectButton to select the
  168.   radio button, and to deselect the other buttons in the radio button’s
  169.   group.
  170.  
  171. • This event will never occur when the watch cursor is displayed, since
  172.   buttons cannot be clicked.  The exception is if the WatchCursorButtons
  173.   procedure has been used to allow the watch cursor to click push-
  174.   buttons.
  175.  
  176. • If your application responds to double-clicks in radio buttons and
  177.   Poll.Button.DoubleClick is true, consider the event to mean “click
  178.   button and OK,” in which case the default button should be flashed and
  179.   the appropriate action taken.
  180.  
  181. • A doButton event is not generated when the user clicks buttons in a
  182.   dialog box, alert box, or desk accessory.  These events are handled
  183.   automatically.
  184.  
  185. Valid Polling Record Fields
  186. ```````````````````````````
  187. Poll.Window
  188. Poll.Button.Num
  189. Poll.Button.DoubleClick
  190. Poll.Modifiers
  191.  
  192. ------------------------------------------------------------------------
  193.  
  194. doMenu (event)
  195. ``````````````
  196. Indicator that the user selected a menu item.
  197.  
  198.   The user selected a menu by either clicking in the menu bar and selecting an item, or by typing a Command key equivalent for a menu item.
  199.  
  200. Programming Considerations
  201. ``````````````````````````
  202. • The menu’s name in the menu bar is automatically highlighted (white
  203.   letters on black background) when the user makes a menu selection.
  204.   Your application must call MenuHilite(0) to remove the highlighting
  205.   when it is finished with its process.
  206.  
  207. • If your application determines that the selected menu item affects the
  208.   active editing field, you may want to validate the field’s edited text
  209.   before allowing the user to complete the action.  If this is the case,
  210.   use GetFieldString to obtain a copy of the edited text, then your
  211.   application can check the string for errors.  If an error is detected,
  212.   display an appropriate alert box then use MenuHilite to remove the
  213.   highlighting from the selected menu.  If no error is detected, call
  214.   the SaveFieldString procedure to save the edited text as the field’s
  215.   string, then complete the menu’s action.
  216.  
  217. • This event will never occur when a modal window is active, or when the
  218.   watch cursor is displayed since the menu cannot be clicked and Command
  219.   key equivalents are ignored.
  220.  
  221. • If the active window has an active editing field, PollSystem will
  222.   process the Edit menu’s Undo, Cut, Copy, Paste, and Clear commands
  223.   automatically.  These selections will not generate doMenu events.
  224.  
  225. • A doMenu event is not generated when the user selects desk accessory
  226.   menus.  These selections are handled automatically.
  227.  
  228. Valid Polling Record Fields
  229. ```````````````````````````
  230. Poll.Menu.Num
  231. Poll.Menu.Item
  232. Poll.Modifiers
  233.  
  234. ------------------------------------------------------------------------
  235.  
  236. doKeyDown (event)
  237. `````````````````
  238. Indicator that the user pressed down a key.
  239.  
  240. The user has pressed down a key on the keyboard or numeric pad, and the key cannot be processed internally by Tools Plus.
  241.  
  242. Programming Considerations
  243. ``````````````````````````
  244. • This event is generated only if the key can not be processed
  245.   internally by Tools Plus.
  246.  
  247. • Command key sequences that are equivalents to menu items generate 
  248.   doMenu events.
  249.  
  250. • The Modifiers field tells your application if the key down event was a
  251.   Command key sequence.  All Command key sequences that are not menu
  252.   equivalents are returned to your application as doKeyDown or doAutoKey
  253.   events.  If your application gets such a Command key sequence, it
  254.   should carry out the appropriate action, or beep the user if the
  255.   Command key sequence is illegal.
  256.  
  257. • If Return or Enter are typed when the active window has a default
  258.   button, a doButton event is reported for the default button.
  259.  
  260. • If an active editing field exists on the active window, key strokes
  261.   will affect the field and will not generate events.  This applies even
  262.   if the field’s length is limited, or if Return has been disallowed in
  263.   a field.
  264.  
  265. • If Tab is typed and the window contains an active editing field, it
  266.   indicates that the user wants to tab to the next field.  Shift-Tab
  267.   indicates tabbing to the previous field.  You may want to validate a
  268.   field’s edited text before allowing the user to tab to the new field.
  269.   If this is the case, use GetFieldString to obtain a copy of the edited
  270.   text, then your application can check the string for errors.  If an
  271.   error is detected, display an appropriate alert box and ignore the
  272.   doKeyDown event.  If no error is detected, call the SaveFieldString
  273.   procedure to save the edited text as the field’s string, then activate
  274.   the new field by using the ActivateField procedure.
  275.  
  276. • If Return is typed and the window contains an active editing field,
  277.   it usually indicates that the user wants to tab to the next field.
  278.   See “Tab” above.  A Return key is reported only if the window does not
  279.   have a default button.
  280.  
  281. • If Enter is typed, it usually indicates that the user wants to enter
  282.   the screen’s data.  This is the same process that is carried out by
  283.   clicking an OK button.  See “Tab” above, regarding validating and
  284.   saving a field’s edited text.  An Enter key is reported only if the
  285.   window does not have a default button.
  286.  
  287. • When the watch cursor is displayed, the only doKeyDown event that will
  288.   be reported is a Command-., which is the user’s request to halt a
  289.   lengthy process.  Other doKeyDown events are discarded.
  290.  
  291. • If the active window has an active editing field, PollSystem
  292.   automatically processes the Command key equivalents for the Edit
  293.   menu’s Undo, Cut, Copy, and Paste commands.  These selections do not
  294.   generate events.
  295.  
  296. • There are two situations where several keys produce the same key
  297.   character: the Clear and Escape keys, and the F1 through F15 keys.  In
  298.   these cases, use the key code to differentiate the keys.  Constants
  299.   are provided for these key characters and key codes.
  300.  
  301. • A doKeyDown event is not generated when the user types in a desk
  302.   accessory.  These key strokes are handled automatically.
  303.  
  304. Valid Polling Record Fields
  305. ```````````````````````````
  306. Poll.Window
  307. Poll.Key.Code
  308. Poll.Key.Chr
  309. Poll.Modifiers
  310.  
  311. ------------------------------------------------------------------------
  312.  
  313. doAutoKey (event)
  314. `````````````````
  315. Indicator that the user held down a key, and it is repeating.
  316.  
  317. The user has pressed down a key on the keyboard or numeric pad, and the key is repeating.  The key cannot be processed internally by Tools Plus.  In most cases, this event should be treated identically to a doKeyDown event.  Each doAutoKey event will follow a doKeyDown of the same sort, so your application may want to make some repeating Command key sequences illegal.
  318.  
  319. Programming Considerations
  320. ``````````````````````````
  321. • This event is generated only if the key can not be processed
  322.   internally by Tools Plus.
  323.  
  324. • Command key sequences that are equivalents to menu items generate
  325.   doMenu events.
  326.  
  327. • The Modifiers field tells your application if the repeating key down
  328.   event was a Command key sequence.  All Command key sequences that are
  329.   not menu equivalents are returned to your application as doKeyDown or
  330.   doAutoKey events.  If your application gets such a Command key
  331.   sequence, it should carry out the appropriate action, or beep the user
  332.   if the Command key sequence is illegal.
  333.  
  334. • If Return or Enter are typed and held down when the active window has
  335.   a default button, a doButton event is reported for the default button.
  336.  
  337. • If an active editing field exists on the active window, repeating keys
  338.   will affect the field and will not generate events.  This applies even
  339.   if the field’s length is limited, or if Return has been disallowed in
  340.   a field.
  341.  
  342. • If Tab is typed and the window contains an active editing field, it
  343.   indicates that the user wants to tab to the next field.  Shift-Tab
  344.   indicates tabbing to the previous field.  You may want to validate a
  345.   field’s edited text before allowing the user to tab to the new field.
  346.     If this is the case, use GetFieldString to obtain a copy of the
  347.   edited text, then your application can check the string for errors.
  348.   If an error is detected, display an appropriate alert box and ignore
  349.   the doKeyDown event.  If no error is detected, call the
  350.   SaveFieldString procedure to save the edited text as the field’s
  351.   string, then activate the new field by using the ActivateField
  352.   procedure.
  353.  
  354. • If Return is typed and the window contains an active editing field,
  355.   it usually indicates that the user wants to tab to the next field.
  356.   See “Tab” above.  A Return key is reported only if the window does not
  357.   have a default button.
  358.  
  359. • If Enter is typed, it usually indicates that the user wants to enter
  360.   the screen’s data.  This is the same process that is carried out by
  361.   clicking an OK button.  See “Tab” above, regarding validating and
  362.   saving a field’s edited text.  An Enter key is reported only if the
  363.   window does not have a default button.  The repeating Enter key may be
  364.   considered illegal because a doKeyDown event will report the first
  365.   Enter, after which your application should have acted accordingly.  An
  366.   Enter key will be reported only if the window does not have a default
  367.   button.
  368.  
  369. • When the watch cursor is displayed, the only doAutoKey event that will
  370.   be reported is a Command-., which is the user’s request to halt a
  371.   lengthy process.  Other doAutoKey events are discarded.
  372.  
  373. • If the active window has an active editing field, PollSystem
  374.   automatically processes the Command key equivalents for the Edit
  375.   menu’s Undo, Cut, Copy, and Paste commands.  These selections do not
  376.   generate events.
  377.  
  378. • There are two situations where several keys produce the same key
  379.   character: the Clear and Escape keys, and the F1 through F15 keys.  In
  380.   these cases, use the key code to differentiate the keys.  Constants
  381.   are provided for these key characters and key codes.
  382.  
  383. • A doAutoKey event is not generated when the user types in a desk
  384.   accessory.  These key strokes are handled automatically.
  385.  
  386. Valid Polling Record Fields
  387. ```````````````````````````
  388. Poll.Window
  389. Poll.Key.Code
  390. Poll.Key.Chr
  391. Poll.Modifiers
  392.  
  393. ------------------------------------------------------------------------
  394.  
  395. doKeyUp (event)
  396. ```````````````
  397. Indicator that the user released a key.
  398.  
  399. The user has released a key on the keyboard or numeric pad, and the key cannot be processed internally by Tools Plus.  Normally the Macintosh does not report doKeyUp events nor do applications typically respond to them.  See “Key-Up Events” in the Designing Your Application chapter for details on the SetEventMask procedure.
  400.  
  401. Programming Considerations
  402. ``````````````````````````
  403. • This event is generated only if your application has used the
  404.   SetEventMask procedure to make the Macintosh respond to key-up events,
  405.   and if the active window does not have an active editing field.
  406.  
  407. • Tools Plus and desk accessories do not require key-up events, and
  408.   therefore ignore them.
  409.  
  410. • There are two situations where several keys produce the same key
  411.   character: the Clear and Escape keys, and the F1 through F15 keys.  In
  412.   these cases, use the key code to differentiate the keys.  Constants
  413.   are provided for these key characters and key codes.
  414.  
  415. • When the watch cursor is displayed, all doKeyUp events are discarded
  416.   and are not generated.
  417.  
  418. Valid Polling Record Fields
  419. ```````````````````````````
  420. Poll.Window
  421. Poll.Key.Code
  422. Poll.Key.Chr
  423. Poll.Modifiers
  424.  
  425. ------------------------------------------------------------------------
  426.  
  427. doClickField (event)
  428. ````````````````````
  429. Indicator that the user clicked in an inactive editing field.
  430.  
  431. When the user clicks in an inactive editing field in the active window, it indicates that the user has finished working with the currently active field and wants to start working with the one that was clicked.  Tools Plus automatically supports the full range of Macintosh user-interface options for editing fields, including (but not limited to):
  432.   • clicking in the field, thereby placing an insertion point
  433.   • dragging across characters to create a selection
  434.   • double-clicking a word to select it
  435.  
  436. Programming Considerations
  437. ``````````````````````````
  438. • The ClickInField procedure is used to process a user’s click in an
  439.   inactive editing field.
  440.  
  441. • If an editing field is active when you receive a doClickField event,
  442.   you may want to validate its edited text before allowing the user to
  443.   click to the new field.  If this is the case, use GetFieldString to
  444.   obtain a copy of the edited text, then your application can check the
  445.   string for errors.  If an error is detected, display an appropriate
  446.   alert box and ignore the doClickField event.  If no error is detected,
  447.   call the SaveFieldString procedure to save the edited text as the
  448.   field’s string, then call the ClickInField procedure to process the
  449.   user’s click in the new field.
  450.  
  451. • Between the time that the doClickField event is reported and the
  452.   ClickInField procedure is used as a response, observe the following
  453.   rules:
  454.       • do not call PollSystem
  455.       • do not open or close any windows
  456.       • do not activate an inactive window
  457.       • do not use alerts or dialogs.
  458.   If these rules are not observed, ClickInField will do nothing and the
  459.   user’s click will be ignored.
  460.  
  461. • An event will not occur if the user clicks in an editing field that is
  462.   already active.
  463.  
  464. • This event will never occur when the watch cursor is displayed, since
  465.   editing fields cannot be clicked.
  466.  
  467. • A doClickField event is not generated when the user clicks in a desk
  468.   accessory’s editing fields.  The process is handled automatically.
  469.  
  470. Valid Polling Record Fields
  471. ```````````````````````````
  472. Poll.Window
  473. Poll.Field
  474. Poll.Modifiers
  475.  
  476. ------------------------------------------------------------------------
  477.  
  478. doScrollBar (event)
  479. ```````````````````
  480. Indicator that user clicked in a scroll bar.
  481.  
  482. The doScrollBar event reports that the user has clicked somewhere in a scroll bar.  The scroll bar has 5 parts: up button, down button, “page up” region, “page down” region, and the thumb.  In all cases, your application should respond to the scroll bar event by scrolling the window’s contents (or portion thereof) and drawing any parts that have been newly revealed due to scrolling.
  483.  
  484. Programming Considerations
  485. ``````````````````````````
  486. • If the scroll bar’s thumb was moved, your application can obtain the
  487.   current value of the scroll bar by calling GetScrollBarVal.  By using
  488.   this value, your application can determine how much to scroll.
  489.  
  490. • If the scroll bar’s up button, down button, “page up” region, or “page
  491.   down” region was clicked, your application must scroll the window by
  492.   the correct amount, then change the scroll bar’s value by using
  493.   SetScrollBarVal.
  494.  
  495. • If the up arrow or “page up” region is clicked, subtract the correct
  496.   amount from the current value.  If the down arrow or “page down”
  497.   region is clicked, add the correct amount to the current value.
  498.  
  499. • If the user holds the mouse button down in the up arrow, “page up”
  500.   region, down arrow, or “page down” region, PollSystem returns a single
  501.   doScrollBar event each time PollSystem is called.  Your application
  502.   doesn’t have to be aware of this, but it is nice to know that scroll
  503.   bar events will not pile up in the queue.
  504.  
  505. • If the user moves the scroll bar’s thumb and returns it to its
  506.   original place during the same drag, an event is not generated.
  507.  
  508. • This event will never occur when the watch cursor is displayed, since
  509.   scroll bars cannot be clicked.
  510.  
  511. • Scroll bars that are part of a list box are handled automatically.
  512.  
  513. • A doScrollBar event is not generated when the user clicks scroll bars
  514.   in a dialog box or desk accessory.  These events are handled
  515.   automatically.
  516.  
  517. Valid Polling Record Fields
  518. ```````````````````````````
  519. Poll.Window
  520. Poll.ScrollBar.Num
  521. Poll.ScrollBar.Part
  522.  
  523. ------------------------------------------------------------------------
  524.  
  525. doListBox (event)
  526. `````````````````
  527. Indicator that user clicked or double-clicked in a list box.
  528.  
  529. The doListBox event reports that the user has clicked somewhere in a list box (on a line that contains text or a blank line).  This event is not generated when the user just scrolls the list box by using its scroll bar.
  530.  
  531. Programming Considerations
  532. ``````````````````````````
  533. • If your application treats double-clicks in list boxes like clicking
  534.   the OK button, use the GetListBoxLine function to determine which line
  535.   was selected (or GetListBoxLines if multiple lines can be selected in
  536.   the list box), then flash the OK button with the FlashButton
  537.   procedure.
  538.  
  539. • This event will never occur when the watch cursor is displayed, since
  540.   list boxes cannot be clicked.
  541.  
  542. • A doListBox event is not generated when the user clicks list boxes in
  543.   a dialog box or desk accessory.  These events are handled
  544.   automatically.
  545.  
  546. Valid Polling Record Fields
  547. ```````````````````````````
  548. Poll.Window
  549. Poll.ListBox.Num
  550. Poll.ListBox.DoubleClick
  551.  
  552. ------------------------------------------------------------------------
  553.  
  554. doClick (event)
  555. ```````````````
  556. Indicator that the user has completed or in the midst of a click, double-click, triple-click, or drag.
  557.  
  558. A click, double-click, triple-click, or drag has been reported in the active window.  The event may still be in progress when PollSystem reports it, such as a double-click with the mouse button still down on the second click.  The Mouse part of the event record contains a field called What, which is the mouse event code that tells your application what type of mouse click has occurred.  The rest of the mouse record contains details on each mouse-down and mouse-up event.
  559.  
  560. A series of decisions are made by PollSystem to obtain single and multiple-click information, as well as drags.  Although they can be somewhat altered by your application (as explained later), the steps taken are as follows:
  561.  
  562.  1  The first mouse-down of a click will be in the active window’s
  563.     content region, and will not be in a button, a scroll bar, an
  564.     editing field, a list box, or a custom control.
  565.  
  566.  2  If no mouse-up event is in the queue, a “single-click, mouse still
  567.     down” mouse event code is returned.  If a mouse-up event is in the
  568.     queue, it is used to complete the click.
  569.  
  570.  3  If the time between the first mouse-down and the first mouse-up
  571.     (single-click) was too long to be the first click of a multiple
  572.     click, PollSystem returns with a “single-click completed” mouse
  573.     event code.
  574.  
  575.  4  If the time between the first mouse-down and the first mouse-up
  576.     (single-click) was short enough to constitute the first click of a
  577.     multiple click, PollSystem checks the event queue for a mouse-down
  578.     event that would be the beginning of a second click.  If a mouse-
  579.     down event is not found in time, PollSystem returns with a “single-
  580.     click completed” mouse event code.
  581.  
  582.  5  If a second mouse-down event is in the queue, it must be in the
  583.     active window’s content region, and must not be in a button, a
  584.     scroll bar, an editing field, a list box, or a custom control.  If
  585.     any of these conditions are violated, the mouse-down event is left
  586.     in the queue and PollSystem returns with a “single-click completed”
  587.     mouse event code.  If the conditions are not violated, PollSystem
  588.     continues.
  589.  
  590.  6  The second click has begun.  If no mouse-up event is in the queue, a
  591.     “double-click, mouse still down” mouse event code is returned.  If a
  592.     mouse-up event is in the queue, it is used to complete the click.
  593.  
  594.  7  If the time between the second mouse-down and the second mouse-up
  595.     (double-click) was too long to be the second click of a triple-
  596.     click, PollSystem returns with a “double-click completed” mouse
  597.     event code.
  598.  
  599.  8  If the time between the second mouse-down and the second mouse-up
  600.     (double-click) was short enough to constitute the second click of a
  601.     triple-click, PollSystem checks the event queue for a mouse-down
  602.     event that would be the beginning of a third click.  If a mouse-down
  603.     event is not found in time, PollSystem returns with a “double-click
  604.     completed” mouse event code.
  605.  
  606.  9  If a third mouse-down event is in the queue, it must be in the
  607.     active window’s content region, and must not be in a button, a
  608.     scroll bar, an editing field, a list box, or a custom control.  If
  609.     any of these conditions are violated, the mouse-down event is left
  610.     in the queue and PollSystem returns with a “double-click completed”
  611.     mouse event code.  If the conditions are not violated, PollSystem
  612.     continues.
  613.  
  614. 10  The third click has begun.  If no mouse-up event is in the queue, a
  615.     “triple-click, mouse still down” mouse event code is returned.  If a
  616.     mouse-up event is in the queue, it is used to complete the click and
  617.     return a “triple-click completed” mouse event code.
  618.  
  619. Programming Considerations
  620. ``````````````````````````
  621. • If at some point your application is only concerned with a mouse down
  622.   in a certain area, or a single-click only, or a double-click only, you
  623.   can disrupt the click as soon as you have obtained enough information
  624.   by using ResetMouseClicks.  For example, if your application only
  625.   cares about a single-click and it gets a “double-click, mouse still
  626.   down” mouse event code, ResetMouseClicks will tell PollSystem “forget
  627.   the rest of this click.”
  628.  
  629. • A triple-click should be scrutinized by your application because the
  630.   time between the third mouse-down and the third mouse-up may be longer
  631.   than the allowable limit for consecutive clicks.  This will also
  632.   happen when the user double-clicks, then presses down the mouse button
  633.   the third time and drags.  Use the GetDblTime function to determine
  634.   the maximum number of clock ticks which can occur between mouse-down
  635.   and up events to constitute a consecutive click.
  636.  
  637. • Your application can place cursor zones on a window, then use
  638.   FindCursorZone to determine if a click occurred in one of those zones.
  639.   This can make parts of your window, such as pictures or icons, click-
  640.   sensitive.  See “Cursors” for information about Cursor Tables and
  641.   Cursor Zones.
  642.  
  643. • This event will never occur when the watch cursor is displayed, since
  644.   only buttons can be (optionally) clicked.
  645.  
  646. • A doClick event is not generated when the user clicks in a desk
  647.   accessory’s editing fields.  The process is handled automatically.
  648.  
  649. Valid Polling Record Fields
  650. ```````````````````````````
  651. Poll.Window
  652. Poll.Mouse.What
  653. Poll.Mouse.Down[1].Where
  654. Poll.Mouse.Down[1].When
  655. Poll.Mouse.Down[1].Modifiers
  656.  
  657. The next three fields are valid only if the mouse event code is inClick1, inClick2Drag, inClick2, inClick3Drag, or inClick3.
  658.  
  659. Poll.Mouse.Up[1].Where
  660. Poll.Mouse.Up[1].When
  661. Poll.Mouse.Up[1].Modifiers
  662.  
  663. The next three fields are valid only if the mouse event code is inClick2Drag, inClick2, inClick3Drag, or inClick3.
  664.  
  665. Poll.Mouse.Down[2].Where
  666. Poll.Mouse.Down[2].When
  667. Poll.Mouse.Down[2].Modifiers
  668.  
  669. The next three fields are valid only if the mouse event code is inClick2, inClick3Drag, or inClick3.
  670.  
  671. Poll.Mouse.Up[2].Where
  672. Poll.Mouse.Up[2].When
  673. Poll.Mouse.Up[2].Modifiers
  674.  
  675. The next three fields are valid only if the mouse event code is inClick3Drag, or inClick3.
  676.  
  677. Poll.Mouse.Down[3].Where
  678. Poll.Mouse.Down[3].When
  679. Poll.Mouse.Down[3].Modifiers
  680.  
  681. The next three fields are valid only if the mouse event code is inClick3.
  682.  
  683. Poll.Mouse.Up[3].Where
  684. Poll.Mouse.Up[3].When
  685. Poll.Mouse.Up[3].Modifiers
  686.  
  687. Poll.Mouse.Where
  688.  
  689.  
  690.   CONST                   {Mouse Event Codes                      }
  691.     inClick1    = 1;      {single-click completed                 }
  692.     inClick2    = 2;      {double-click completed                 }
  693.     inClick3    = 3;      {triple-click completed                 }
  694.     inClick1Drag=-1;      {single-click, mouse still down         }
  695.     inClick2Drag=-2;      {double-click, mouse still down         }
  696.     inClick3Drag=-3;      {triple-cli